import { getCards } from '../../utils/networkRequest.js'
// pages/membercard/membercard.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    cards: []
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    let self = this;
    getCards((r) => { 
      if (r.code == 0) {
        self.setData({
          cards: r.data
        })
       
      }
    })
  },
  //跳转至会员卡详情
  goMemberCardInfo:function(e){ 
    debugger;
     let item = e.currentTarget.dataset.item
    wx.navigateTo({
      url: '../membercardinfo/membercardinfo?item=' + JSON.stringify(item)
    })
  }
})